//
//  MyCollectionViewCell.m
//  中药香
//
//  Created by qq q on 2017/3/22.
//  Copyright © 2017年 金拇指集团. All rights reserved.
//

#import "MyCollectionViewCell.h"

NSString *const kMyCollectionViewCellID = @"kMyCollectionViewCellID";

@interface MyCollectionViewCell()

@end

@implementation MyCollectionViewCell

- (void)prepareForReuse {
    [super prepareForReuse];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    
    if (self) {
        [self setupViews];
    }
    
    return self;
}

- (void)setupViews {
    if (_imageView) {
        return;
    }

    self.backgroundColor = [UIColor whiteColor];
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    _imageView = ({
        UIImageView *imageView = [UIImageView new];
        imageView.contentMode = UIViewContentModeScaleAspectFill;
        imageView.clipsToBounds = YES;
        [self.contentView addSubview:imageView];
        [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.edges.equalTo(self.contentView);
            make.width.equalTo(self.contentView);
            make.height.equalTo(self.contentView);
        }];
        
        imageView;
    });
    
    _projectTitle = ({
        UILabel *title = [UILabel new];
        title.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:title];
        title.textColor = [UIColor whiteColor];
        [title mas_makeConstraints:^(MASConstraintMaker *make){
            make.width.equalTo(self.contentView);
            make.height.mas_equalTo(20);
            make.top.equalTo(_imageView.mas_bottom).offset(10);
        }];
        
        title;
    });
    
    
}

#pragma mark - Public Method
- (void)configureCellWithPostURL:(NSString *)posterURL {
    _imageView.image = [UIImage imageNamed:@""];
}

@end
